Rename BlockRestriction -> BlockRestrictionStore and wire it up as a service
[lhc/web/wiklou.git] / includes / specials / pagers / BlockListPager.php
index 496013b..d09b345 100644 (file)
@@ -22,7 +22,6 @@
 /**
  * @ingroup Pager
  */
-use MediaWiki\Block\BlockRestriction;
 use MediaWiki\Block\Restriction\Restriction;
 use MediaWiki\Block\Restriction\PageRestriction;
 use MediaWiki\Block\Restriction\NamespaceRestriction;
@@ -161,7 +160,7 @@ class BlockListPager extends TablePager {
                                        $formatted .= '<br />' . $this->msg(
                                                'ipb-blocklist-duration-left',
                                                $language->formatDuration(
-                                                       $timestamp->getTimestamp() - time(),
+                                                       $timestamp->getTimestamp() - MWTimestamp::time(),
                                                        // reasonable output
                                                        [
                                                                'minutes',
@@ -191,10 +190,8 @@ class BlockListPager extends TablePager {
                        case 'ipb_params':
                                $properties = [];
 
-                               if ( $this->getConfig()->get( 'EnablePartialBlocks' ) ) {
-                                       if ( $row->ipb_sitewide ) {
-                                               $properties[] = htmlspecialchars( $msg['blocklist-editing-sitewide'] );
-                                       }
+                               if ( $this->getConfig()->get( 'EnablePartialBlocks' ) && $row->ipb_sitewide ) {
+                                       $properties[] = htmlspecialchars( $msg['blocklist-editing-sitewide'] );
                                }
 
                                if ( !$row->ipb_sitewide && $this->restrictions ) {
@@ -421,7 +418,8 @@ class BlockListPager extends TablePager {
                if ( $partialBlocks ) {
                        // Mutations to the $row object are not persisted. The restrictions will
                        // need be stored in a separate store.
-                       $this->restrictions = BlockRestriction::loadByBlockId( $partialBlocks );
+                       $blockRestrictionStore = MediaWikiServices::getInstance()->getBlockRestrictionStore();
+                       $this->restrictions = $blockRestrictionStore->loadByBlockId( $partialBlocks );
                }
 
                $lb->execute();